package com.fanhang.samples.retrofit.jos;

import com.fanhang.samples.retrofit.ApiAdapter;

public class JosApiAdapter extends ApiAdapter {
	
	private String url;
	private String appKey;
	private String accessToken;
	private String sign;
	private String format = "";
	private String version = "";
	
	public JosApiAdapter(String url) {
		this.url = url;
	}
	
	public JosApiAdapter(String url, String appKey, String accessToken, String sign) {
		this.url = url;
		this.appKey = appKey;
		this.accessToken = accessToken;
		this.sign = sign;
		this.format = "json";
		this.version = "2.0";
	}

	@Override
	public <T> T create(Class<T> clazz) {
		return super.create(clazz.getClassLoader(), new Class<?>[] { clazz }, new MethodHandler(url, appKey, accessToken, sign, format, version));
	}
	
	
}
